import {Describer} from "./base";


export class HourPartDescriber extends Describer {
  singleNumberSegment(exp: string): string {
    return `${exp}点`;
  }

  spanSegment(exp: string): string {
    const {start, end} = super.parseSpan(exp)
    return `${start}点到${end}点`;
  }

  spanSlashNumberSegment(exp: string): string {
    const {start, end, interval} = super.parseSpanSlashNumber(exp)

    return `${start}点到${end}点之间每隔${interval}小时`;
  }

  starSegment(exp: string): string {
    return "每小时";
  }

  starSlashNumberSegment(exp: string): string {
    const interval = exp.replace('*/', '')
    return `每${interval}小时`;
  }

}
